\(\int (-\frac {b \cosh (a+b x+c x^2)}{x}+\frac {\sinh (a+b x+c x^2)}{x^2}) \, dx\) [5]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 33, antiderivative size = 107 \[ \int \left (-\frac {b \cosh \left (a+b x+c x^2\right )}{x}+\frac {\sinh \left (a+b x+c x^2\right )}{x^2}\right ) \, dx=\frac {1}{2} \sqrt {c} e^{-a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b+2 c x}{2 \sqrt {c}}\right )+\frac {1}{2} \sqrt {c} e^{a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {b+2 c x}{2 \sqrt {c}}\right )-\frac {\sinh \left (a+b x+c x^2\right )}{x} \]

[Out]

-sinh(c*x^2+b*x+a)/x+1/2*exp(-a+1/4*b^2/c)*erf(1/2*(2*c*x+b)/c^(1/2))*c^(1/2)*Pi^(1/2)+1/2*exp(a-1/4*b^2/c)*er
fi(1/2*(2*c*x+b)/c^(1/2))*c^(1/2)*Pi^(1/2)

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.152, Rules used = {5498, 5483, 2266, 2235, 2236} \[ \int \left (-\frac {b \cosh \left (a+b x+c x^2\right )}{x}+\frac {\sinh \left (a+b x+c x^2\right )}{x^2}\right ) \, dx=\frac {1}{2} \sqrt {\pi } \sqrt {c} e^{\frac {b^2}{4 c}-a} \text {erf}\left (\frac {b+2 c x}{2 \sqrt {c}}\right )+\frac {1}{2} \sqrt {\pi } \sqrt {c} e^{a-\frac {b^2}{4 c}} \text {erfi}\left (\frac {b+2 c x}{2 \sqrt {c}}\right )-\frac {\sinh \left (a+b x+c x^2\right )}{x} \]

[In]

Int[-((b*Cosh[a + b*x + c*x^2])/x) + Sinh[a + b*x + c*x^2]/x^2,x]

[Out]

(Sqrt[c]*E^(-a + b^2/(4*c))*Sqrt[Pi]*Erf[(b + 2*c*x)/(2*Sqrt[c])])/2 + (Sqrt[c]*E^(a - b^2/(4*c))*Sqrt[Pi]*Erf
i[(b + 2*c*x)/(2*Sqrt[c])])/2 - Sinh[a + b*x + c*x^2]/x

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 2266

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 5483

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[1/2, Int[E^(a + b*x + c*x^2), x], x] + Dist[1/2
, Int[E^(-a - b*x - c*x^2), x], x] /; FreeQ[{a, b, c}, x]

Rule 5498

Int[((d_.) + (e_.)*(x_))^(m_)*Sinh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[(d + e*x)^(m + 1)*(Si
nh[a + b*x + c*x^2]/(e*(m + 1))), x] + (-Dist[(b*e - 2*c*d)/(e^2*(m + 1)), Int[(d + e*x)^(m + 1)*Cosh[a + b*x
+ c*x^2], x], x] - Dist[2*(c/(e^2*(m + 1))), Int[(d + e*x)^(m + 2)*Cosh[a + b*x + c*x^2], x], x]) /; FreeQ[{a,
 b, c, d, e}, x] && LtQ[m, -1] && NeQ[b*e - 2*c*d, 0]

Rubi steps \begin{align*} \text {integral}& = -\left (b \int \frac {\cosh \left (a+b x+c x^2\right )}{x} \, dx\right )+\int \frac {\sinh \left (a+b x+c x^2\right )}{x^2} \, dx \\ & = -\frac {\sinh \left (a+b x+c x^2\right )}{x}+(2 c) \int \cosh \left (a+b x+c x^2\right ) \, dx \\ & = -\frac {\sinh \left (a+b x+c x^2\right )}{x}+c \int e^{-a-b x-c x^2} \, dx+c \int e^{a+b x+c x^2} \, dx \\ & = -\frac {\sinh \left (a+b x+c x^2\right )}{x}+\left (c e^{a-\frac {b^2}{4 c}}\right ) \int e^{\frac {(b+2 c x)^2}{4 c}} \, dx+\left (c e^{-a+\frac {b^2}{4 c}}\right ) \int e^{-\frac {(-b-2 c x)^2}{4 c}} \, dx \\ & = \frac {1}{2} \sqrt {c} e^{-a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b+2 c x}{2 \sqrt {c}}\right )+\frac {1}{2} \sqrt {c} e^{a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {b+2 c x}{2 \sqrt {c}}\right )-\frac {\sinh \left (a+b x+c x^2\right )}{x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.44 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.23 \[ \int \left (-\frac {b \cosh \left (a+b x+c x^2\right )}{x}+\frac {\sinh \left (a+b x+c x^2\right )}{x^2}\right ) \, dx=\frac {\sqrt {c} \sqrt {\pi } x \text {erf}\left (\frac {b+2 c x}{2 \sqrt {c}}\right ) \left (\cosh \left (a-\frac {b^2}{4 c}\right )-\sinh \left (a-\frac {b^2}{4 c}\right )\right )+\sqrt {c} \sqrt {\pi } x \text {erfi}\left (\frac {b+2 c x}{2 \sqrt {c}}\right ) \left (\cosh \left (a-\frac {b^2}{4 c}\right )+\sinh \left (a-\frac {b^2}{4 c}\right )\right )-2 \sinh (a+x (b+c x))}{2 x} \]

[In]

Integrate[-((b*Cosh[a + b*x + c*x^2])/x) + Sinh[a + b*x + c*x^2]/x^2,x]

[Out]

(Sqrt[c]*Sqrt[Pi]*x*Erf[(b + 2*c*x)/(2*Sqrt[c])]*(Cosh[a - b^2/(4*c)] - Sinh[a - b^2/(4*c)]) + Sqrt[c]*Sqrt[Pi
]*x*Erfi[(b + 2*c*x)/(2*Sqrt[c])]*(Cosh[a - b^2/(4*c)] + Sinh[a - b^2/(4*c)]) - 2*Sinh[a + x*(b + c*x)])/(2*x)

Maple [F]

\[\int \left (-\frac {b \cosh \left (c \,x^{2}+b x +a \right )}{x}+\frac {\sinh \left (c \,x^{2}+b x +a \right )}{x^{2}}\right )d x\]

[In]

int(-b*cosh(c*x^2+b*x+a)/x+sinh(c*x^2+b*x+a)/x^2,x)

[Out]

int(-b*cosh(c*x^2+b*x+a)/x+sinh(c*x^2+b*x+a)/x^2,x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 331 vs. \(2 (81) = 162\).

Time = 0.25 (sec) , antiderivative size = 331, normalized size of antiderivative = 3.09 \[ \int \left (-\frac {b \cosh \left (a+b x+c x^2\right )}{x}+\frac {\sinh \left (a+b x+c x^2\right )}{x^2}\right ) \, dx=-\frac {\sqrt {\pi } {\left (x \cosh \left (c x^{2} + b x + a\right ) \cosh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + x \cosh \left (c x^{2} + b x + a\right ) \sinh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + {\left (x \cosh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + x \sinh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} + b x + a\right )\right )} \sqrt {-c} \operatorname {erf}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, c}\right ) - \sqrt {\pi } {\left (x \cosh \left (c x^{2} + b x + a\right ) \cosh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - x \cosh \left (c x^{2} + b x + a\right ) \sinh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + {\left (x \cosh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - x \sinh \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} + b x + a\right )\right )} \sqrt {c} \operatorname {erf}\left (\frac {2 \, c x + b}{2 \, \sqrt {c}}\right ) + \cosh \left (c x^{2} + b x + a\right )^{2} + 2 \, \cosh \left (c x^{2} + b x + a\right ) \sinh \left (c x^{2} + b x + a\right ) + \sinh \left (c x^{2} + b x + a\right )^{2} - 1}{2 \, {\left (x \cosh \left (c x^{2} + b x + a\right ) + x \sinh \left (c x^{2} + b x + a\right )\right )}} \]

[In]

integrate(-b*cosh(c*x^2+b*x+a)/x+sinh(c*x^2+b*x+a)/x^2,x, algorithm="fricas")

[Out]

-1/2*(sqrt(pi)*(x*cosh(c*x^2 + b*x + a)*cosh(-1/4*(b^2 - 4*a*c)/c) + x*cosh(c*x^2 + b*x + a)*sinh(-1/4*(b^2 -
4*a*c)/c) + (x*cosh(-1/4*(b^2 - 4*a*c)/c) + x*sinh(-1/4*(b^2 - 4*a*c)/c))*sinh(c*x^2 + b*x + a))*sqrt(-c)*erf(
1/2*(2*c*x + b)*sqrt(-c)/c) - sqrt(pi)*(x*cosh(c*x^2 + b*x + a)*cosh(-1/4*(b^2 - 4*a*c)/c) - x*cosh(c*x^2 + b*
x + a)*sinh(-1/4*(b^2 - 4*a*c)/c) + (x*cosh(-1/4*(b^2 - 4*a*c)/c) - x*sinh(-1/4*(b^2 - 4*a*c)/c))*sinh(c*x^2 +
 b*x + a))*sqrt(c)*erf(1/2*(2*c*x + b)/sqrt(c)) + cosh(c*x^2 + b*x + a)^2 + 2*cosh(c*x^2 + b*x + a)*sinh(c*x^2
 + b*x + a) + sinh(c*x^2 + b*x + a)^2 - 1)/(x*cosh(c*x^2 + b*x + a) + x*sinh(c*x^2 + b*x + a))

Sympy [F]

\[ \int \left (-\frac {b \cosh \left (a+b x+c x^2\right )}{x}+\frac {\sinh \left (a+b x+c x^2\right )}{x^2}\right ) \, dx=- \int \left (- \frac {\sinh {\left (a + b x + c x^{2} \right )}}{x^{2}}\right )\, dx - \int \frac {b \cosh {\left (a + b x + c x^{2} \right )}}{x}\, dx \]

[In]

integrate(-b*cosh(c*x**2+b*x+a)/x+sinh(c*x**2+b*x+a)/x**2,x)

[Out]

-Integral(-sinh(a + b*x + c*x**2)/x**2, x) - Integral(b*cosh(a + b*x + c*x**2)/x, x)

Maxima [F]

\[ \int \left (-\frac {b \cosh \left (a+b x+c x^2\right )}{x}+\frac {\sinh \left (a+b x+c x^2\right )}{x^2}\right ) \, dx=\int { -\frac {b \cosh \left (c x^{2} + b x + a\right )}{x} + \frac {\sinh \left (c x^{2} + b x + a\right )}{x^{2}} \,d x } \]

[In]

integrate(-b*cosh(c*x^2+b*x+a)/x+sinh(c*x^2+b*x+a)/x^2,x, algorithm="maxima")

[Out]

integrate(-b*cosh(c*x^2 + b*x + a)/x + sinh(c*x^2 + b*x + a)/x^2, x)

Giac [F]

\[ \int \left (-\frac {b \cosh \left (a+b x+c x^2\right )}{x}+\frac {\sinh \left (a+b x+c x^2\right )}{x^2}\right ) \, dx=\int { -\frac {b \cosh \left (c x^{2} + b x + a\right )}{x} + \frac {\sinh \left (c x^{2} + b x + a\right )}{x^{2}} \,d x } \]

[In]

integrate(-b*cosh(c*x^2+b*x+a)/x+sinh(c*x^2+b*x+a)/x^2,x, algorithm="giac")

[Out]

integrate(-b*cosh(c*x^2 + b*x + a)/x + sinh(c*x^2 + b*x + a)/x^2, x)

Mupad [F(-1)]

Timed out. \[ \int \left (-\frac {b \cosh \left (a+b x+c x^2\right )}{x}+\frac {\sinh \left (a+b x+c x^2\right )}{x^2}\right ) \, dx=\int \frac {\mathrm {sinh}\left (c\,x^2+b\,x+a\right )}{x^2}-\frac {b\,\mathrm {cosh}\left (c\,x^2+b\,x+a\right )}{x} \,d x \]

[In]

int(sinh(a + b*x + c*x^2)/x^2 - (b*cosh(a + b*x + c*x^2))/x,x)

[Out]

int(sinh(a + b*x + c*x^2)/x^2 - (b*cosh(a + b*x + c*x^2))/x, x)